package com.be.beadmin.service.entity;

import com.be.beadmin.common.entity.BaseEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;

/**
 *
 */
@Entity
@Getter
@Setter
@Table(name="T_SERIAL_NUMBER_ITEM")
public class SerialNumberItem extends BaseEntity {

    /**
     * 关联主表ID
     */
    @ManyToOne(fetch = FetchType.LAZY,cascade = CascadeType.ALL)
    @JoinColumn(name = "SERIAL_NUMBER_ID",columnDefinition = "VARCHAR(45) COMMENT '字典主表信息' ")
    private SerialNumber serialNumber;

    /**
     * 0:常规类型 1:日期类型
     */
    @Column(name = "TYPE",columnDefinition = "INT COMMENT '编码位数' ")
    private Integer type;

    /**
     * 类型指定的值
     */
    @Column(name = "RULE",columnDefinition = "VARCHAR(50) COMMENT '编码' ")
    private String rule;
    /**
     * 排序
     */
    @Column(name = "SORT",columnDefinition = "INT COMMENT '编码位数' ")
    private Integer sort;

    /**
     * 是否随着时间变化
     */
    @Column(name = "FOLLOW_DATE")
    private Boolean followDate = false;
}
